Skip to main content

SSH Access

You can connect to the shell of your compute resources over SSH. This is helpful for development, troubleshooting and testing.

ssh -t cgc@cgc-api.comtegra.cloud -p 2222 RESOURCE [COMMAND]

It will run [COMMAND] in the default container of RESOURCE. If you don't specify the command, by default it will be /bin/sh.

If you'd like to connect to the container of a running job, add job/ before the resource name like this.

ssh -t cgc@cgc-api.comtegra.cloud -p 2222 job/RESOURCE [COMMAND]

Rsync file synchronization​

You can use rsync to sync your files from/to your containers

rsync -e 'ssh -p 2222' --rsync-path 'RESOURCE rsync' SRC cgc@cgc-api.comtegra.cloud:DST

Configuration​

The only way to authenticate is via a key, so the first step is to generate one.

mkdir -p ~/.ssh/keys
ssh-keygen -f ~/.ssh/keys/cgc
info

By default, this command will ask for a new password. You'll have to provide this password each time you use the key. This is because otherwise anyone that gets hold of your key file would be able to run arbitrary commands on your behalf.

You may press ENTER without providing a password or add -N '' to the above command to skip adding the key password.

Then, configure your SSH client to use this key automatically when authenticating to CGC.

echo "
Host cgc-api.comtegra.cloud
IdentityFile ~/.ssh/keys/cgc
" >> ~/.ssh/config

Next, add this key to your CGC account.

info

SSH keys are unique cluster wide. You can not use the same key for few namespaces

cgc keys ssh create -pk "$(cat ~/.ssh/keys/cgc.pub)"

Now you should be able to log into your compute resources.

ssh -t cgc@cgc-api.comtegra.cloud -p 2222 RESOURCE-NAME [COMMAND]